import { getGuideMsgs, getGuideDetail } from '@/api/guide'
export default {
  namespaced: true,
  state: ()=>({
    // 考试信息
    guideMsgs: {},
  }),
  mutations: {
    // 设置考试信息
    setGuides(state, data) {
      state.guideMsgs = data
    },

  },
  actions: {
    // 获取考试信息
    async getGuideMsgs({ commit }, params) {
      let res = await getGuideMsgs(params).catch(err => {
        return {
          errcode: 0,
          data: {}
        }
      })
      commit('setGuides', res.data || {})
    },
    // 获取指南详情
    async getGuideDetail({ commit }, params) {
      let res = await getGuideDetail(params).catch(err => {
        return {
          errcode: 0,
          data: {}
        }
      })
      commit('setGuides', res.data || {})
    }
  },
  getters: {}
}